package cn.icanci.ladybird.service.impl;

import cn.icanci.ladybird.pojo.entity.TicketSeatTicketPriceMiddle;
import cn.icanci.ladybird.dao.TicketSeatTicketPriceMiddleDao;
import cn.icanci.ladybird.service.TicketSeatTicketPriceMiddleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (TicketSeatTicketPriceMiddle)表服务实现类
 *
 * @author makejava
 * @since 2020-09-29 20:44:57
 */
@Service("ticketSeatTicketPriceMiddleService")
public class TicketSeatTicketPriceMiddleServiceImpl implements TicketSeatTicketPriceMiddleService {
    @Resource
    private TicketSeatTicketPriceMiddleDao ticketSeatTicketPriceMiddleDao;

    /**
     * 通过ID查询单条数据
     *
     * @param ticketSeatTicketPriceMiddleId 主键
     * @return 实例对象
     */
    @Override
    public TicketSeatTicketPriceMiddle queryById(Long ticketSeatTicketPriceMiddleId) {
        return this.ticketSeatTicketPriceMiddleDao.queryById(ticketSeatTicketPriceMiddleId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<TicketSeatTicketPriceMiddle> queryAllByLimit(int offset, int limit) {
        return this.ticketSeatTicketPriceMiddleDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param ticketSeatTicketPriceMiddle 实例对象
     * @return 实例对象
     */
    @Override
    public TicketSeatTicketPriceMiddle insert(TicketSeatTicketPriceMiddle ticketSeatTicketPriceMiddle) {
        this.ticketSeatTicketPriceMiddleDao.insert(ticketSeatTicketPriceMiddle);
        return ticketSeatTicketPriceMiddle;
    }

    /**
     * 修改数据
     *
     * @param ticketSeatTicketPriceMiddle 实例对象
     * @return 实例对象
     */
    @Override
    public TicketSeatTicketPriceMiddle update(TicketSeatTicketPriceMiddle ticketSeatTicketPriceMiddle) {
        this.ticketSeatTicketPriceMiddleDao.update(ticketSeatTicketPriceMiddle);
        return this.queryById(ticketSeatTicketPriceMiddle.getTicketSeatTicketPriceMiddleId());
    }

    /**
     * 通过主键删除数据
     *
     * @param ticketSeatTicketPriceMiddleId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long ticketSeatTicketPriceMiddleId) {
        return this.ticketSeatTicketPriceMiddleDao.deleteById(ticketSeatTicketPriceMiddleId) > 0;
    }

    @Override
    public List<TicketSeatTicketPriceMiddle> queryManyById(Long ticketSeatTicketPriseMiddleId) {
        return this.ticketSeatTicketPriceMiddleDao.queryManyById(ticketSeatTicketPriseMiddleId);
    }

    @Override
    public TicketSeatTicketPriceMiddle queryBySeatId(Long ticketSeatMiddleId) {
        return this.ticketSeatTicketPriceMiddleDao.queryBySeatId(ticketSeatMiddleId);
    }


}